#include <iostream>
using namespace std;
int main()
{
    string s, t; cin >> s;
    int cnt = 0, sum = 0;
    for (int i = 0; i <= s.size(); i++)
    {
        if (s[i] == 'a')
        {
            cnt++;
            sum = max(cnt, sum);
        }
        else
        {
            cnt = 0;
        }
    }
    while (sum--)
    {
        t += 'a';
    }
    cout << t << endl;
    return 0;
}